import urllib2,urllib,sys,os,re
from publib import lib

url = 'http://astro.lady.qq.com/head_123.htm'
url_blog = ''
h1_begin = '<table border="0" cellspacing="0" cellpadding="0">'
h1_end = '</table>'
contents = urllib2.urlopen('http://blog.qq.com/qzone/31485226/1305335550.htm')
c = contents.read()
print c
sys.exit()
c_begin = c.find(h1_begin)
c_end = c.find(h1_end)
realc=  c[c_begin:c_end]
linkIds = re.findall(r'qzone\/(\d*)\/(\d*)\.htm">(.*?)<\/a>',realc,re.S)
if linkIds:
    for i in linkIds :
        url_blog = "{'title':'%s','url':'http://blog.qq.com/qzone/%s/%s.htm'}" % (i[2],i[0],i[1])
        print url_blog
        print lib().md5sum(url_blog)
        